//教师主页路由配置
var app = angular.module('appTeacher', ['ngResource', 'ngRoute', 'oc.lazyLoad', 'ngCookies']);
app.config(function ($routeProvider, $ocLazyLoadProvider, $locationProvider) {
    $locationProvider.hashPrefix('');
    $routeProvider
    //主页
        .when('/', {
            templateUrl: '/modules/teacher/tmpl/index.html',
            controller: 'indexCtrl',
            resolve: {
                loadMyCtrl: ['$ocLazyLoad', function ($ocLazyLoad) {
                    return $ocLazyLoad.load([{
                        serie: true,
                        files: ['/modules/teacher/controllers/indexCtr.js','http://cdn1.avatar-edu.cn/js/teacher/jquery.min.js']
                    }]);
                }]
            }
        })
        //教师个人题库
        .when('/queslibs', {
            templateUrl: '/modules/teacher/tmpl/myQuestionBank.html',
            controller: 'quesCtr',
            resolve: {
                loadMyCtrl: ['$ocLazyLoad', function ($ocLazyLoad) {
                    return $ocLazyLoad.load([{
                        serie: true,
                        files: ['/modules/teacher/controllers/quesCtr.js']
                    }]);
                }]
            }
        })
        .when('/err', {
            templateUrl: '/modules/teacher/tmpl/class.html',
            controller: 'errCtr',
            resolve: {
                loadMyCtrl: ['$ocLazyLoad', function ($ocLazyLoad) {
                    return $ocLazyLoad.load('/modules/teacher/controllers/errCtr.js');
                }]
            }
        })
        //教师个人设置页面
        .when('/set', {
            templateUrl: '/modules/set.html',
            controller: 'setCtr',
            resolve: {
                loadMyCtrl: ['$ocLazyLoad', function ($ocLazyLoad) {
                    return $ocLazyLoad.load([{
                        serie: true,
                        files: ['/modules/teacher/controllers/setCtr.js']
                    }]);
                }]
            }
        })
        //教师密码设置页面
        .when('/reg', {
            templateUrl: '/modules/register.html',
            controller: 'regCtr',
            resolve: {
                loadMyCtrl: ['$ocLazyLoad', function ($ocLazyLoad) {
                    return $ocLazyLoad.load([{
                        serie: true,
                        files: ['/modules/teacher/controllers/regCtr.js','http://cdn1.avatar-edu.cn/js/teacher/jquery.min.js']
                    }]);
                }]
            }
        })
        .when('/stuerr', {
            templateUrl: '/modules/teacher/tmpl/error.html',
            controller: 'stuerr',
            resolve: {
                loadMyCtrl: ['$ocLazyLoad', function ($ocLazyLoad) {
                    return $ocLazyLoad.load([{
                        serie: true,
                        files: ['/modules/teacher/controllers/stuerr.js']
                    }]);
                }]
            }
        })
        .when('/stuerr', {
            templateUrl: '/modules/teacher/tmpl/error.html',
            controller: 'stuerr',
            resolve: {
                loadMyCtrl: ['$ocLazyLoad', function ($ocLazyLoad) {
                    return $ocLazyLoad.load([{
                        serie: true,
                        files: ['/modules/teacher/controllers/stuerr.js']
                    }]);
                }]
            }
        });
    //教师查看学生错题集
    // .otherwise({//其他跳转至主页
    //     redirectTo:'/'
    // })
});